<script>
export default {
  name: 'App',
  computed: {
    isAuthenticated() {
      return !!localStorage.getItem('token');
    }
  },
  methods: {
    logout() {
      localStorage.removeItem('token');
      this.$router.push('/login');
    }
  }
}
</script>

<template>
  <div id="app">
    
    <main class="app-content">
      <router-view />
    </main>
    
    <footer class="app-footer">
      <div class="container">
        <p>&copy; {{ new Date().getFullYear() }} 威胁情报威胁情报图谱构建和可信度评估系统</p>
      </div>
    </footer>
  </div>
</template>

<style>
/* Reset and base styles */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
    Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: #333;
  background-color: #f8f9fa;
}

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 30px;
}

/* Header styles */
.app-header {
  background-color: white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 0;
  z-index: 100;
}

.app-header .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 80px;
}

.logo a {
  color: #007bff;
  font-size: 1.8rem;
  font-weight: 700;
  text-decoration: none;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link {
  color: #333;
  text-decoration: none;
  font-weight: 500;
  font-size: 1.1rem;
  padding: 8px 0;
  position: relative;
  transition: all 0.3s ease;
}

.nav-link:hover {
  color: #007bff;
}

.nav-link.router-link-active {
  color: #007bff;
}

.nav-link.router-link-active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background-color: #007bff;
}

.logout-btn {
  background-color: transparent;
  color: #dc3545;
  border: 1px solid #dc3545;
  padding: 8px 16px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  transition: all 0.3s ease;
}

.logout-btn:hover {
  background-color: #dc3545;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(220, 53, 69, 0.2);
}

/* Main content styles */
.app-content {
  min-height: calc(100vh - 80px - 60px); /* viewport height - header - footer */
}

/* Footer styles */
.app-footer {
  background-color: #343a40;
  color: white;
  padding: 20px 0;
  text-align: center;
}

/* Responsive styles */
@media (max-width: 768px) {
  .app-header .container {
    flex-direction: column;
    height: auto;
    padding: 15px 20px;
  }
  
  .logo {
    margin-bottom: 15px;
  }
  
  .main-nav {
    flex-wrap: wrap;
    justify-content: center;
    gap: 20px;
  }
  
  .nav-link {
    font-size: 1rem;
  }
}

/* Desktop Enhancements */
@media (min-width: 1200px) {
  .container {
    padding: 0 50px;
  }
  
  .app-header .container {
    height: 90px;
  }
  
  .logo a {
    font-size: 2rem;
  }
  
  .nav-link {
    font-size: 1.2rem;
  }
  
  .logout-btn {
    padding: 10px 20px;
    font-size: 1.1rem;
  }
}
</style>
